﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

public partial class 退房 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Bind();
            GridView1.Visible = false;
        }
        
    }
    protected void Bind()
    {
        users us = new users();
        GridView1.DataSource = us.Getone(us);
        GridView1.DataBind();
    }


    protected void btnSeart_Click(object sender, EventArgs e)
    {
        users us = new users();
        us.number = tbSeart.Text.Trim();
        GridView1.DataSource = us.Getone(us);
        GridView1.DataBind();
        GridView1.Visible = true;
    }
    protected void btn_submit_Click(object sender, EventArgs e)
    {
           

            string number = tbSeart.Text.Trim();
            string num = null;

            users us = new users();
            us.num = num;
            us.number=number;   
            
            int result = us.UpT(us);
            if (result > 0)
            {
                Response.Write("<script>alert(\"退房成功！\")</script>");
                Bind();

            }
           
        }

       /* string num = tbSeart.Text.Trim();
        string name = null;
        string number = null;
        string tel = null;
        string rte = null;
        string tte = null;
        string penson = null;
        string free = null;

       
       
        us.name = name;
        us.number = number;
        us.tel = tel;
        us.rte = rte;
        us.tte = tte;
        us.penson = penson;
        us.free = free;*/
      
    }
